<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
</head>
<body>
<div id="app">
    <template v-if="Object.keys(info).length">
        <h2>个人信息：</h2>
        <ul>
            <li>姓名：{{info.name}}</li>
            <li>年龄：{{info.age}}</li>
        </ul>
    </template>

    <template v-else>
        <div>
            暂无信息！
        </div>
    </template>

</div>
<script src="https://unpkg.com/vue@3"></script>
<script>
    const app=Vue.createApp({
        data(){
            return{
                info:{
                    // name:'why',age:24
                }
            }
        }
    })

    app.mount("#app")
</script>
</body>
</html>